﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XKJ.OAWeb.Infrastructrue;
using XKJ.OAWeb.Models;

namespace XKJ.OAWeb.Application
{
    public class UserRoleService : IUserRoleService
    {
        IBaseRepository<UserRole> _userRole;

        public UserRoleService(IBaseRepository<UserRole> userRole)
        {
            _userRole = userRole;
        }
        //添加
        public int UserRoleAdd(UserRole userRole)
        {
            return _userRole.Add(userRole);
        }
        //显示+查询
        public List<UserRole> UserRoleShow(int Id)
        {
            var list = _userRole.Show().Where(x => x.UId == Id).ToList();

            return list;
        }
    }
}
